<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
/**
 *
 * theme-options.inc.php include file
 *
 * (c) 2011 by Mike Walsh
 *
 * @author Mike Walsh <mike@walshcrew.com>
 * @package mshsbc
 * @subpackage options
 * @version $Revision$
 * @lastmodified $Author$
 * @lastmodifiedby $Date$
 *
 */

//  The TEMPLATEPATH constant can't be used for child
//  themes as it returns the parent theme path so we
//  need to figure out what MSHSBCTTHEMEPATH is ...

define("MSHSBCTHEMEPATH", get_stylesheet_directory()) ;

//  Define constants to drive the theme options page.
//  These values are important and should not be changed
//  as they drive the selection of the proper header
//  image and CSS file.

define('MSHSBC_THEME_COLOR_SCHEME_RED', 'red') ;
define('MSHSBC_THEME_COLOR_SCHEME_BLUE', 'blue') ;
define('MSHSBC_THEME_COLOR_SCHEME_GREEN', 'green') ;
define('MSHSBC_THEME_COLOR_SCHEME_YELLOW', 'yellow') ;
define('MSHSBC_THEME_DEFAULT_COLOR_SCHEME', MSHSBC_THEME_COLOR_SCHEME_RED) ;

define('MSHSBC_THEME_COLOR_SCHEME_IMAGE', 'mshsbc-%s-scheme.png') ;
define('MSHSBC_THEME_COLOR_SCHEME_IMAGE_DISPLAY_WIDTH', '400px') ;
define('MSHSBC_THEME_COLOR_SCHEME_IMAGE_DISPLAY_HEIGHT', '100px') ;

define('MSHSBC_THEME_OPTION_HIL', 'mshsbclfthdrimg') ;
define('MSHSBC_THEME_OPTION_HIC', 'mshsbcctrhdrimg') ;
define('MSHSBC_THEME_OPTION_HIR', 'mshsbcrghthdrimg') ;
define('MSHSBC_THEME_OPTION_HDR_DIV_CSS', 'mshsbchdrdivcss') ;
define('MSHSBC_THEME_OPTION_HIL_DIV_CSS', 'mshsbclfthdrdivcss') ;
define('MSHSBC_THEME_OPTION_HIL_IMG_CSS', 'mshsbclfthdrimgcss') ;
define('MSHSBC_THEME_OPTION_HIC_DIV_CSS', 'mshsbcctrhdrdivcss') ;
define('MSHSBC_THEME_OPTION_HIC_IMG_CSS', 'mshsbcctrhdrimgcss') ;
define('MSHSBC_THEME_OPTION_HIR_DIV_CSS', 'mshsbcrghthdrdivcss') ;
define('MSHSBC_THEME_OPTION_HIR_IMG_CSS', 'mshsbcrghthdrimgcss') ;
define('MSHSBC_THEME_OPTION_COLOR_SCHEME', 'mshsbcclrschm') ;
define('MSHSBC_THEME_OPTION_BLOG_TITLE_CSS', 'mshsbctitlecss') ;
define('MSHSBC_THEME_OPTION_BLOG_TAGLINE_CSS', 'mshsbctaglinecss') ;
define('MSHSBC_THEME_OPTION_BRANDING_DIV_CSS', 'mshsbcbrandingcss') ;
define('MSHSBC_THEME_OPTION_THUMBNAIL_SCALE_FACTOR', 'mshsbcthmbsclfctr') ;

//  Default theme options

define('MSHSBC_THEME_OPTION_HIL_DEFAULT', '') ;
define('MSHSBC_THEME_OPTION_HIC_DEFAULT', '') ;
define('MSHSBC_THEME_OPTION_HIR_DEFAULT', '') ;
define('MSHSBC_THEME_OPTION_HDR_DIV_CSS_DEFAULT', '') ;
define('MSHSBC_THEME_OPTION_HIL_DIV_CSS_DEFAULT', '') ;
define('MSHSBC_THEME_OPTION_HIL_IMG_CSS_DEFAULT', '') ;
define('MSHSBC_THEME_OPTION_HIC_DIV_CSS_DEFAULT', '') ;
define('MSHSBC_THEME_OPTION_HIC_IMG_CSS_DEFAULT', '') ;
define('MSHSBC_THEME_OPTION_HIR_DIV_CSS_DEFAULT', '') ;
define('MSHSBC_THEME_OPTION_HIR_IMG_CSS_DEFAULT', '') ;
define('MSHSBC_THEME_OPTION_COLOR_SCHEME_DEFAULT', MSHSBC_THEME_DEFAULT_COLOR_SCHEME) ;
define('MSHSBC_THEME_OPTION_BLOG_TITLE_CSS_DEFAULT', '') ;
define('MSHSBC_THEME_OPTION_BLOG_TAGLINE_CSS_DEFAULT', '') ;
define('MSHSBC_THEME_OPTION_BRANDING_DIV_CSS_DEFAULT', '') ;
define('MSHSBC_THEME_OPTION_THUMBNAIL_SCALE_FACTOR_DEFAULT', 0.67) ;

/**
 * Returns the default options for MSHSBC.
 *
 * @since MSHSBC 1.0
 */
function mshsbc_get_default_theme_options()
{
	$default_theme_options = array(
        MSHSBC_THEME_OPTION_HIL => MSHSBC_THEME_OPTION_HIL_DEFAULT
       ,MSHSBC_THEME_OPTION_HIC => MSHSBC_THEME_OPTION_HIC_DEFAULT
       ,MSHSBC_THEME_OPTION_HIR => MSHSBC_THEME_OPTION_HIR_DEFAULT
       ,MSHSBC_THEME_OPTION_HDR_DIV_CSS => MSHSBC_THEME_OPTION_HDR_DIV_CSS_DEFAULT
       ,MSHSBC_THEME_OPTION_HIL_DIV_CSS => MSHSBC_THEME_OPTION_HIL_DIV_CSS_DEFAULT
       ,MSHSBC_THEME_OPTION_HIL_IMG_CSS => MSHSBC_THEME_OPTION_HIL_IMG_CSS_DEFAULT
       ,MSHSBC_THEME_OPTION_HIC_DIV_CSS => MSHSBC_THEME_OPTION_HIC_DIV_CSS_DEFAULT
       ,MSHSBC_THEME_OPTION_HIC_IMG_CSS => MSHSBC_THEME_OPTION_HIC_IMG_CSS_DEFAULT
       ,MSHSBC_THEME_OPTION_HIR_DIV_CSS => MSHSBC_THEME_OPTION_HIR_DIV_CSS_DEFAULT
       ,MSHSBC_THEME_OPTION_HIR_IMG_CSS => MSHSBC_THEME_OPTION_HIR_IMG_CSS_DEFAULT
       ,MSHSBC_THEME_OPTION_COLOR_SCHEME => MSHSBC_THEME_OPTION_COLOR_SCHEME_DEFAULT
       ,MSHSBC_THEME_OPTION_BLOG_TITLE_CSS => MSHSBC_THEME_OPTION_BLOG_TITLE_CSS_DEFAULT
       ,MSHSBC_THEME_OPTION_BLOG_TAGLINE_CSS => MSHSBC_THEME_OPTION_BLOG_TAGLINE_CSS_DEFAULT
       ,MSHSBC_THEME_OPTION_BRANDING_DIV_CSS => MSHSBC_THEME_OPTION_BRANDING_DIV_CSS_DEFAULT
       ,MSHSBC_THEME_OPTION_THUMBNAIL_SCALE_FACTOR => MSHSBC_THEME_OPTION_THUMBNAIL_SCALE_FACTOR_DEFAULT
	) ;

	return apply_filters('mshsbc_default_theme_options', $default_theme_options) ;
}

/**
 * Returns the options array for MSHSBC.
 *
 * @since MSHSBC 1.0
 */
function mshsbc_get_theme_options()
{
    //  Get the default options in case anything new has been added
    $default_options = mshsbc_get_default_theme_options() ;

    //  Merge the default with any options currently saves by WordPress
    $theme_options = wp_parse_args(get_option( 'mshsbc_theme_options', array() ), $default_options);

    return $theme_options ;
}
?>
